Skip to content

[cherry-pick] promote exception to property, add test (#3471) - #3486

Merged
Westin Musser (westin-m) merged 7 commits into
dev8xfrom
westin/cherry-pick-exception-fix
Jul 22, 2026
Merged

[cherry-pick] promote exception to property, add test (#3471)#3486
Westin Musser (westin-m) merged 7 commits into
dev8xfrom
westin/cherry-pick-exception-fix

Conversation

@westin-m

Copy link
Copy Markdown
Contributor

cherry pick #3471 into dev/8x

@westin-m
Westin Musser (westin-m) marked this pull request as ready for review May 13, 2026 17:44
@westin-m
Westin Musser (westin-m) requested a review from a team as a code owner May 13, 2026 17:44
@westin-m Westin Musser (westin-m) changed the title promote exception to property, add test (#3471) [cherry-pick] promote exception to property, add test (#3471) May 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cherry-picks the fix from #3471 to address a blocking-path bug in ConfigurationManager<T> where metadata fetch failures could lose the original exception during the backoff window, preventing callers from classifying client (4xx) vs server (5xx) errors.

Changes:

  • Promote the blocking-path fetch failure exception from a local variable to an instance field so it persists across calls within _syncAfter backoff.
  • Clear the persisted failure on successful retrieval/update to avoid stale errors.
  • Add a regression test ensuring the inner exception (and HttpDocumentRetriever.StatusCode in Exception.Data) is preserved during the backoff window.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerTests.cs Adds a regression test verifying the blocking backoff path preserves the original inner exception/status code.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs Introduces an instance field to persist the most recent blocking-path fetch failure across calls.
src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager_Blocking.cs Uses the persisted failure field (set on failure, cleared on success) when throwing during the backoff window.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, the comments added in the test were really helpful.

@debchoudhury-id4s debchoudhury-id4s left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was there a blocker preventing backporting #3471 earlier? Or was this timing intentional? Asking to learn about any possible release improvement.

@westin-m

Copy link
Copy Markdown
Contributor Author

was there a blocker preventing backporting #3471 earlier? Or was this timing intentional? Asking to learn about any possible release improvement.

The only blocker was lack of reviews

This was referenced Aug 6, 2026
Sondre Sjølyst (sondresjolyst) pushed a commit to sondresjolyst/nstuning-api that referenced this pull request Aug 9, 2026
…22.0 (#104)

Updated
[System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet)
from 8.21.0 to 8.22.0.

<details>
<summary>Release notes</summary>

_Sourced from [System.IdentityModel.Tokens.Jwt's
releases](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases)._

## 8.22.0

## What's Changed

* Promote exception to property, add test by @​westin-m in
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3486
* Add IgnoreCaseWhenValidatingAudience flag to audience validation by
@​cpp11nullptr in
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3563

**Full Changelog**:
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.21.0...8.22.0

Commits viewable in [compare
view](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.21.0...8.22.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=System.IdentityModel.Tokens.Jwt&package-manager=nuget&previous-version=8.21.0&new-version=8.22.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants